#pragma once

#include "socket_types.h"


class InetAddress {
public:
    InetAddress(const char* ip, uint16_t port, bool ipv6 = false);
    InetAddress(in_addr_type addr);
    InetAddress(in6_addr_type addr6);

    uint16_t family() const;
    uint16_t port() const;
    bool isIpv6() const;
    std::string ip() const;
    std::string ipPort() const;
    sockaddr_type* addr() const;
private:
    bool ipv6_;
    union {
        in_addr_type addr_;
        in6_addr_type addr6_;
    };
};


